//---------------------------------------------------------------------
//  This file is part of the Background Motion solution.
// 
//  Copyright (C) Mindscape (TM).  All rights reserved.
//  http://www.mindscape.co.nz
// 
//  THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//---------------------------------------------------------------------

using System.Collections.Generic;
using System.Xml;
using Mindscape.BackgroundMotion.Model;
using Mindscape.BackgroundMotion.Website.Infrastructure;

namespace Mindscape.BackgroundMotion.Website.Controllers
{
  public interface IContributionController : IController
  {
    /// <summary>
    /// View a <see cref="Contribution"/>
    /// </summary>
    Contribution ViewContribution(int id);

    /// <summary>
    /// Gets a <see cref="Contribution"/>.
    /// </summary>
    /// <param name="id">The id of the <see cref="Contribution"/> to return.</param>
    Contribution GetContribution(int id);

    /// <summary>
    /// Gets a Contribution from an external provider which can translate the requested identifier
    /// </summary>
    /// <param name="provider">The provider.</param>
    /// <param name="identifier">The identifier which will be understood by the provider and return a Contribution.</param>
    Contribution GetContributionFromExternalProvider(string provider, string identifier);

    /// <summary>
    /// Gets the unmoderated contributions.
    /// </summary>
    IList<Contribution> GetUnmoderatedContributions();

    /// <summary>
    /// Gets the most recent list of <see cref="Contribution"/>s filtered by <see cref="ContentType"/>
    /// </summary>
    /// <param name="contentTypeId">The identifier of the ContentType to filter by.</param>
    IList<Contribution> GetMostRecentByContentType(int contentTypeId);

    /// <summary>
    /// Adds a new <see cref="Contribution"/>.
    /// </summary>
    void AddContribution(Contribution contribution);

    /// <summary>
    /// Updates an existing <see cref="Contribution"/>.
    /// </summary>
    void UpdateContribution(Contribution contribution);

    /// <summary>
    /// Approves an unmoderated <see cref="Contribution"/>.
    /// </summary>
    /// <param name="id">The unique identifier of the Contribution.</param>
    void ApproveContribution(int id);

    /// <summary>
    /// Deletes an existing <see cref="Contribution"/>.
    /// </summary>
    /// <param name="id">The unique identifier of the Contribution.</param>
    void DeleteContribution(int id);

    /// <summary>
    /// Gets the popular tags.
    /// </summary>
    IList<Tag> GetPopularTags();

    /// <summary>
    /// Gets all tags.
    /// </summary>
    IList<Tag> GetAllTags();

    /// <summary>
    /// Searches the specified page number.
    /// </summary>
    /// <param name="pageNumber">The page number.</param>
    ISearchResult Search(int pageNumber);

    /// <summary>
    /// Gets an RSS feed associated with the current application view
    /// </summary>
    /// <param name="channel">The text in the channel element for the RSS feed.</param>
    /// <param name="description">The text in the description element for the RSS feed.</param>
    XmlDocument GetRssFeed(string channel, string description);
  }
}